/**
* component FormItem
* prefix .mui-formitem
*/
.width(@n) {
  width: percentage(1 / @n); // calc(1/@n*100%);
}

// &.mui-formitem-width-[1~2]
.width-n(@n, @i: 1) when (@i <= @n) {
  &.mui-formitem-width-@{i} {
    .width(@i);
  }

  .width-n(@n, (@i + 1));
}

.mui-formgroup {
  display: block;
  width: 100%;
  float: left;
  margin-bottom: 16px;
  &:after {
    content: '';
    display: block;
    width: 100%;
    clear: both;
    margin-top: 1px;
    margin-bottom: 1px;
  }
}

.mui-formitem {
  display: block;
  width: 100%;
  float: left;
  margin-bottom: 16px;
  input::-webkit-input-placeholder{
    color: #dcdcdc!important;
  }
  input:-moz-placeholder{
    color: #dcdcdc!important;
  }
  input:-ms-input-placeholder{
    color: #dcdcdc!important;
  }
  &.formItem-read {
    .mui-formitem-label {
      color: #757575!important;
    }

  }
  &.formItem-workflow-write {
    .mui-formitem-label {
      color: #2196f3!important;
    }
  }
  &.formItem-write {
    .mui-formitem-label {
      color: #333!important;
    }
  }
  .placeholder{
    color: #dcdcdc;
  }
  &:after {
    content: '';
    display: block;
    width: 100%;
    clear: both;
    margin-top: 1px;
    margin-bottom: 1px;
  }

  .width-n(2);

  & > .mui-formitem-label {
    display: block;
    width: 84px;
    height: 36px;
    color: #9e9e9e;
    padding-left: 16px;
    padding-right: 16px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: right;
    font-size: 14px;
    line-height: 36px;
    float: left;
    position: relative;
    box-sizing: initial;
    &:after {
      content: '*';
      width: 10px;
      height: 16px;
      text-align: center;
      font-size: 16px;
      line-height: 16px;
      position: absolute;
      top: 13px;
      right: 6px;
      display: none;
    }
  }

  & > .mui-formitem-control {
    width: 100%;
    padding-left: 116px;
    box-sizing: border-box;
    font-size: 0;

    & > .intl-tel-input,
    & > .mui-fileattachment {
      font-size: 12px;
    }

    // add component prefix here
    & > .mui-textinput,
    & > .mui-radiogroup,
    & > .mui-dropdown,
    & > .mui-datetime,
    & > .mui-datetimerange,
    & > .mui-userpicker,
    & > .mui-departmentpicker,
    & > .mui-areapicker,
    & > .intl-tel-input,
    & > .intl-tel-input .mui-phonenumber,
    & > .mui-companypicker,
    & > .mui-textview,
    & > .mui-fileattachment,
    & > .mui-range,
    & > .mui-linkpicker {
      width: 100%;
    }
  }

  & > .mui-formitem-message {
    display: block;
    padding-top: 4px;
    padding-left: 128px;
    font-size: 13px;
    line-height: 20px;
    color: #9e9e9e;
  }

  &.mui-formitem-required {
    & > .mui-formitem-label {
      &:after {
        display: block;
      }
    }
  }

  &.mui-formitem-error {
    & > .mui-formitem-label,
    & > .mui-formitem-message {
      color: #f44336;
    }
  }
}
